package com.longer.demo.framework.validator;

import org.apache.commons.lang3.StringUtils;

import java.util.Map;

/**
 * @program: mybatis
 * @description:
 * @author: SunBiaoLong
 * @create: 2019-01-14 10:40
 **/
public class ValidationResult {
	private boolean hasErrors=false;
	private Map<String, String> errorMsgMap;

	/**
	 * 返回消息错误码
	 * @return
	 */
	public String getErrorMsg(){
		return StringUtils.join(errorMsgMap.values().toArray(), ",");
	}
	public Map<String, String> getErrorMsgMap() {
		return errorMsgMap;
	}

	public void setErrorMsgMap(Map<String, String> errorMsgMap) {
		this.errorMsgMap = errorMsgMap;
	}

	public boolean isHasErrors() {

		return hasErrors;
	}

	public void setHasErrors(boolean hasErrors) {
		this.hasErrors = hasErrors;
	}
}
